home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / glibmm-2.4 / proc / m4 / convert_gdk.m4 < prev    next >
Text File  |  2006-04-20  |  12KB  |  232 lines

  1. include(convert_glib.m4)
  2.  
  3. _EQUAL(gint8[],gint8*)
  4. _EQUAL(guchar,guint8)
  5. _EQUAL(guchar*,guint8*)
  6. _EQUAL(gfloat,float)
  7.  
  8. # Enums
  9. _CONV_ENUM(Gdk,AxisUse)
  10. _CONV_ENUM(Gdk,ByteOrder)
  11. _CONV_ENUM(Gdk,CapStyle)
  12. _CONV_ENUM(Gdk,Colorspace)
  13. _CONV_ENUM(Gdk,CursorType)
  14. _CONV_ENUM(Gdk,DragAction)
  15. _CONV_ENUM(Gdk,DragProtocol)
  16. _CONV_ENUM(Gdk,EventMask)
  17. _CONV_ENUM(Gdk,EventType)
  18. _CONV_ENUM(Gdk,ExtensionMode)
  19. _CONV_ENUM(Gdk,Fill)
  20. _CONV_ENUM(Gdk,FillRule)
  21. _CONV_ENUM(Gdk,Function)
  22. _CONV_ENUM(Gdk,GCValuesMask)
  23. _CONV_ENUM(Gdk,Gravity)
  24. _CONV_ENUM(Gdk,ImageType)
  25. _CONV_ENUM(Gdk,InputCondition)
  26. _CONV_ENUM(Gdk,InputMode)
  27. _CONV_ENUM(Gdk,InterpType)
  28. _CONV_ENUM(Gdk,JoinStyle)
  29. _CONV_ENUM(Gdk,LineStyle)
  30. _CONV_ENUM(Gdk,ModifierType)
  31. _CONV_ENUM(Gdk,OverlapType)
  32. _CONV_ENUM(Gdk,PixbufAlphaMode)
  33. _CONV_ENUM(Gdk,RgbDither)
  34. _CONV_ENUM(Gdk,Status)
  35. _CONV_ENUM(Gdk,SubwindowMode)
  36. _CONV_ENUM(Gdk,VisualType)
  37. _CONV_ENUM(Gdk,WindowAttributesType)
  38. _CONV_ENUM(Gdk,WindowEdge)
  39. _CONV_ENUM(Gdk,WindowHints)
  40. _CONV_ENUM(Gdk,WindowState)
  41. _CONV_ENUM(Gdk,WindowType)
  42. _CONV_ENUM(Gdk,WindowTypeHint)
  43. _CONV_ENUM(Gdk,WMDecoration)
  44. _CONV_ENUM(Gdk,WMFunction)
  45. _CONV_ENUM(Gdk,GrabStatus)
  46.  
  47.  
  48. _CONVERSION(`Gdk::EventMask',`gint',`$3')
  49. _CONVERSION(`gint',`Gdk::EventMask',`static_cast<Gdk::EventMask>($3)')
  50. _CONVERSION(`ModifierType&',`GdkModifierType*',`(($2) &($3))')
  51. _CONVERSION(`WMDecoration&',`GdkWMDecoration*',`(($2) &($3))')
  52. _CONVERSION(`GdkDragProtocol&',`GdkDragProtocol*',`&($3)')
  53.  
  54. _CONVERSION(`GdkRectangle&',`GdkRectangle*',`&$3',`*$3')
  55. _CONVERSION(`GdkRgbCmap&',`GdkRgbCmap*',`&$3',`*$3')
  56.  
  57. # TODO: Remove this, and use Gdk::Device:
  58. _CONVERSION(`GdkDevice*',`const GdkDevice*',`$3')
  59.  
  60. _CONVERSION(`GdkKeymap*',`const GdkKeymap*',`$3')
  61.  
  62.  
  63.  
  64.  
  65. # for GtkStyle public struct members
  66. _CONVERSION(`Gdk::Color',`GdkColor', `(*($3).gobj())')
  67. _CONVERSION(`GdkColor',`Gdk::Color', `Gdk::Color(const_cast<GdkColor*>(&($3)), true)')
  68.  
  69. # Ref (gdkmm) -> Ptr (gtk+)
  70. _CONVERSION(`Color&',`GdkColor*',($3).gobj())
  71. _CONVERSION(`Rectangle&',`GdkRectangle*',($3).gobj())
  72. _CONVERSION(`Gdk::Rectangle&',`GdkRectangle*',($3).gobj())
  73. _CONVERSION(`Font&',`GdkFont*',($3).gobj())
  74. _CONVERSION(`Region&',`GdkRegion*',($3).gobj())
  75.  
  76. _CONVERSION(`const Glib::RefPtr<Gdk::Colormap>&',`GdkColormap*',__CONVERT_REFPTR_TO_P)
  77. _CONVERSION(`const Glib::RefPtr<Gdk::Pixmap>&',`GdkPixmap*',__CONVERT_REFPTR_TO_P)
  78. _CONVERSION(`const Glib::RefPtr<Gdk::Window>&',`GdkWindow*',__CONVERT_REFPTR_TO_P)
  79. _CONVERSION(`const Glib::RefPtr<Window>&',`GdkWindow*',__CONVERT_REFPTR_TO_P)
  80. _CONVERSION(`const Glib::RefPtr<Pixmap>&',`GdkPixmap*',__CONVERT_REFPTR_TO_P)
  81. _CONVERSION(`const Glib::RefPtr<Gdk::Pixmap>&',`GdkPixmap*',__CONVERT_REFPTR_TO_P)
  82. _CONVERSION(`const Glib::RefPtr<Bitmap>&',`GdkBitmap*',__CONVERT_REFPTR_TO_P)
  83. _CONVERSION(`const Glib::RefPtr<Gdk::Bitmap>&',`GdkBitmap*',__CONVERT_REFPTR_TO_P)
  84. _CONVERSION(`const Glib::RefPtr<Colormap>&',`GdkColormap*',__CONVERT_REFPTR_TO_P)
  85. _CONVERSION(`const Glib::RefPtr<const Colormap>&',`GdkColormap*',__CONVERT_CONST_REFPTR_TO_P_SUN(Colormap))
  86. _CONVERSION(`const Glib::RefPtr<GC>&',`GdkGC*',`Glib::unwrap<Gdk::GC>($3)')
  87. _CONVERSION(`const Glib::RefPtr<const GC>&',`GdkGC*',__CONVERT_CONST_REFPTR_TO_P_SUN(GC))
  88. _CONVERSION(`const Glib::RefPtr<Gdk::GC>&',`GdkGC*',__CONVERT_REFPTR_TO_P)
  89. _CONVERSION(`const Glib::RefPtr<Drawable>&',`GdkDrawable*',__CONVERT_REFPTR_TO_P)
  90. _CONVERSION(`const Glib::RefPtr<const Drawable>&',`GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
  91. _CONVERSION(`const Glib::RefPtr<Image>&',`GdkImage*',__CONVERT_REFPTR_TO_P)
  92. _CONVERSION(`const Glib::RefPtr<const Image>&',`GdkImage*',__CONVERT_CONST_REFPTR_TO_P_SUN(Image))
  93. _CONVERSION(`const Glib::RefPtr<Gdk::Image>&',`GdkImage*',__CONVERT_REFPTR_TO_P)
  94. _CONVERSION(`const Glib::RefPtr<Pixbuf>&',`GdkPixbuf*',__CONVERT_REFPTR_TO_P)
  95. _CONVERSION(`const Glib::RefPtr<const Pixbuf>&',`GdkPixbuf*',__CONVERT_CONST_REFPTR_TO_P_SUN(Pixbuf))
  96. _CONVERSION(`const Glib::RefPtr<Gdk::Pixbuf>&',`GdkPixbuf*',__CONVERT_REFPTR_TO_P)
  97. _CONVERSION(`Glib::RefPtr<Gdk::Pixbuf>',`GdkPixbuf*',__CONVERT_REFPTR_TO_P)
  98. _CONVERSION(`const Glib::RefPtr<Gdk::PixbufAnimation>&',`GdkPixbufAnimation*',__CONVERT_REFPTR_TO_P)
  99. _CONVERSION(`const Glib::RefPtr<Gdk::PixbufAnimationIter>&',`GdkPixbufAnimationIter*',__CONVERT_REFPTR_TO_P)
  100. _CONVERSION(`const Glib::RefPtr<Gdk::DragContext>&',`GdkDragContext*',__CONVERT_REFPTR_TO_P)
  101. _CONVERSION(`const Glib::RefPtr<Display>&',`GdkDisplay*',__CONVERT_REFPTR_TO_P)
  102. _CONVERSION(`const Glib::RefPtr<Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
  103. _CONVERSION(`const Glib::RefPtr<Gdk::Display>&',`GdkDisplay*',__CONVERT_REFPTR_TO_P)
  104. _CONVERSION(`const Glib::RefPtr<Gdk::Screen>&',`GdkScreen*',__CONVERT_REFPTR_TO_P)
  105.  
  106.  
  107.  
  108. define(`__CFR2P',`const_cast<$`'2>($`'3.gobj())')
  109. _CONVERSION(const Font&,GdkFont*,__CFR2P)
  110. _CONVERSION(const Gdk::Color&,GdkColor*,__CFR2P)
  111. _CONVERSION(const Color&,GdkColor*,__CFR2P)
  112. _CONVERSION(const Gdk::Rectangle&,GdkRectangle*,__CFR2P)
  113. _CONVERSION(const Rectangle&,GdkRectangle*,__CFR2P)
  114. _CONVERSION(const Gdk::Geometry&,GdkGeometry*,const_cast<$2>(&($3)))
  115. _CONVERSION(const Geometry&,GdkGeometry*,const_cast<$2>(&($3)))
  116. _CONVERSION(const RgbCmap&,GdkRgbCmap*,__CFR2P)
  117.  
  118. _CONVERSION(`Gdk::Rectangle*',`GdkRectangle*',`Glib::unwrap($3)')
  119. _CONVERSION(`const Gdk::Rectangle*',`GdkRectangle*',`Glib::unwrap(const_cast<Gdk::Rectangle*>($3))')
  120. _CONVERSION(`GdkRectangle*',`Gdk::Rectangle*',`&Glib::wrap($3)')
  121. _CONVERSION(`GdkRectangle*',`const Gdk::Rectangle*',`&Glib::wrap($3)')
  122. _CONVERSION(`GdkRectangle*',`const Gdk::Rectangle&',`Glib::wrap($3)')
  123.  
  124.  
  125. dnl TODO: Should this always be a copy?
  126. _CONVERSION(const Cursor&,GdkCursor*,($3).gobj_copy())
  127.  
  128. # Special treatment for the Sun Forte compiler
  129. #_CONVERSION(const Glib::RefPtr<const Gdk::Pixmap>&,GdkPixmap*,__CONVERT_CONST_REFPTR_TO_P)
  130. #_CONVERSION(const Glib::RefPtr<const Gdk::Window>&,GdkWindow*,__CONVERT_CONST_REFPTR_TO_P)
  131. #_CONVERSION(const Glib::RefPtr<const Gdk::Colormap>&,GdkColormap*,__CONVERT_CONST_REFPTR_TO_P)
  132. #_CONVERSION(const Glib::RefPtr<const Gdk::Visual>&,GdkVisual*,__CONVERT_CONST_REFPTR_TO_P)
  133. #_CONVERSION(const Glib::RefPtr<const Gdk::Bitmap>&,GdkBitmap*,__CONVERT_CONST_REFPTR_TO_P)
  134. #_CONVERSION(const Glib::RefPtr<const Gdk::Image>&,GdkImage*,__CONVERT_CONST_REFPTR_TO_P)
  135. #_CONVERSION(const Glib::RefPtr<const Gdk::GC>&,GdkGC*,__CONVERT_CONST_REFPTR_TO_P)
  136.  
  137. _CONVERSION(`const Glib::RefPtr<const Gdk::Pixmap>&', `GdkPixmap*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Pixmap))
  138. _CONVERSION(`const Glib::RefPtr<const Gdk::Window>&', `GdkWindow*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Window))
  139. _CONVERSION(`const Glib::RefPtr<const Window>&', `GdkWindow*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Window))
  140. _CONVERSION(`const Glib::RefPtr<const Gdk::Colormap>&', `GdkColormap*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Colormap))
  141. _CONVERSION(`const Glib::RefPtr<const Gdk::Visual>&', `GdkVisual*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Visual))
  142. _CONVERSION(`const Glib::RefPtr<const Gdk::Bitmap>&', `GdkBitmap*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Bitmap))
  143. _CONVERSION(`const Glib::RefPtr<const Gdk::Image>&', `GdkImage*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Image))
  144. _CONVERSION(`const Glib::RefPtr<const Image>&', `GdkImage*',__CONVERT_CONST_REFPTR_TO_P_SUN(Image))
  145. _CONVERSION(`const Glib::RefPtr<const Gdk::GC>&', `GdkGC*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::GC))
  146. _CONVERSION(`const Glib::RefPtr<const GC>&', `GdkGC*',__CONVERT_CONST_REFPTR_TO_P_SUN(GC))
  147. #_CONVERSION(`const Glib::RefPtr<const Gdk::Drawable>&', `GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gdk::Drawable))
  148. #_CONVERSION(`const Glib::RefPtr<const Drawable>&', `GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
  149. #_CONVERSION(`const Glib::RefPtr<const Display>&', `GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
  150.  
  151.  
  152. _CONVERSION(`GdkWindow*',`Glib::RefPtr<Window>', `Glib::wrap((GdkWindowObject*)($3))')
  153. _CONVERSION(`GdkWindow*',`Glib::RefPtr<const Window>', `Glib::wrap((GdkWindowObject*)($3))')
  154. _CONVERSION(`GdkWindow*',`Glib::RefPtr<Gdk::Window>', `Glib::wrap((GdkWindowObject*)($3))')
  155. _CONVERSION(`GdkWindow*',`Glib::RefPtr<const Gdk::Window>', `Glib::wrap((GdkWindowObject*)($3))')
  156. _CONVERSION(`GdkWindow*',`const Glib::RefPtr<Gdk::Window>&', `Glib::wrap((GdkWindowObject*)($3), true)')
  157. _CONVERSION(`GdkPixmap*',`Glib::RefPtr<Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
  158. _CONVERSION(`GdkPixmap*',`Glib::RefPtr<const Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
  159. _CONVERSION(`GdkPixmap*',`Glib::RefPtr<const Gdk::Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
  160. _CONVERSION(`GdkPixmap*',`Glib::RefPtr<Gdk::Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
  161. _CONVERSION(`GdkColormap*',`Glib::RefPtr<Colormap>', `Glib::wrap($3)')
  162. _CONVERSION(`GdkColormap*',`Glib::RefPtr<const Colormap>', `Glib::wrap($3)')
  163. _CONVERSION(`GdkColormap*',`Glib::RefPtr<Gdk::Colormap>', `Glib::wrap($3)')
  164. _CONVERSION(`GdkVisual*',`Glib::RefPtr<Gdk::Visual>', `Glib::wrap($3)')
  165. _CONVERSION(`GdkVisual*',`Glib::RefPtr<Visual>', `Glib::wrap($3)')
  166. _CONVERSION(`GdkVisual*',`Glib::RefPtr<const Visual>', `Glib::wrap($3)')
  167. _CONVERSION(`GdkImage*',`Glib::RefPtr<Image>', `Glib::wrap($3)')
  168. _CONVERSION(`GdkPixbuf*',`Glib::RefPtr<Pixbuf>', `Glib::wrap($3)')
  169. _CONVERSION(`GdkPixbuf*',`Glib::RefPtr<Gdk::Pixbuf>', `Glib::wrap($3)')
  170. _CONVERSION(`GdkPixbufAnimationIter*',`Glib::RefPtr<PixbufAnimationIter>', `Glib::wrap($3)')
  171. _CONVERSION(`GdkPixbuf*',`Glib::RefPtr<Gdk::Pixbuf>', Glib::wrap($3))
  172. _CONVERSION(`GdkPixbufAnimation*',`Glib::RefPtr<Gdk::PixbufAnimation>', `Glib::wrap($3)')
  173. _CONVERSION(`GdkGC*',`Glib::RefPtr<Gdk::GC>', `Glib::wrap($3)')
  174. _CONVERSION(`GdkGC*',`Glib::RefPtr<const Gdk::GC>', `Glib::wrap($3)')
  175.  
  176. _CONVERSION(`GdkDisplay*',`Glib::RefPtr<Display>', `Glib::wrap($3)')
  177. _CONVERSION(`GdkDisplay*',`Glib::RefPtr<const Display>', `Glib::wrap($3)')
  178. _CONVERSION(`GdkDisplay*',`Glib::RefPtr<Gdk::Display>', `Glib::wrap($3)')
  179. _CONVERSION(`GdkDisplay*',`Glib::RefPtr<const Gdk::Display>', `Glib::wrap($3)')
  180.  
  181. _CONVERSION(`GdkDisplayManager*',`Glib::RefPtr<DisplayManager>', `Glib::wrap($3)')
  182. _CONVERSION(`GdkDisplayManager*',`Glib::RefPtr<const DisplayManager>', `Glib::wrap($3)')
  183.  
  184. _CONVERSION(`GdkScreen*',`Glib::RefPtr<Screen>', `Glib::wrap($3)')
  185. _CONVERSION(`GdkScreen*',`Glib::RefPtr<const Screen>', `Glib::wrap($3)')
  186. _CONVERSION(`GdkScreen*',`Glib::RefPtr<Gdk::Screen>', `Glib::wrap($3)')
  187. _CONVERSION(`GdkScreen*',`Glib::RefPtr<const Gdk::Screen>', `Glib::wrap($3)')
  188.  
  189. _CONVERSION(`GdkDevice*',`Glib::RefPtr<Device>', `Glib::wrap($3)')
  190. _CONVERSION(`GdkDevice*',`Glib::RefPtr<const Device>', `Glib::wrap($3)')
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198. # Glib::ListHandle<> (gdkmm) -> GList (gdk)
  199. _CONVERSION(`const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >&',`GList*',`$3.data()')
  200.  
  201. # GList (gdk) -> Glib::ListHandle<> (gdkmm)
  202. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
  203. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Device> >',`$2($3, Glib::OWNERSHIP_DEEP)')
  204. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Visual> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
  205. _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Window> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
  206. _CONVERSION(`GSList*',`Glib::SListHandle< Glib::RefPtr<Display> >',`$2($3, Glib::OWNERSHIP_SHALLOW)')
  207.  
  208.  
  209.  
  210.  
  211. # XPM data
  212. _CONVERSION(`const char*const*',`const char**',`const_cast<const char**>($3)',`$3')
  213.  
  214.  
  215. _CONVERSION(GdkFont*, Gdk::Font, `Gdk::Font($3)')
  216. _CONVERSION(GdkEvent*, Event, `Event($3)')
  217. _CONVERSION(GdkRegion*, Region, `Region($3)')
  218.  
  219. _CONVERSION(`GdkTimeCoord**&',`GdkTimeCoord***',`&($3)')
  220.  
  221. dnl _CONVERSION(GdkPixmap*,Gdk::Pixmap&,`Glib::unwrap_boxed($3)',`$3')
  222. dnl _CONVERSION(GdkBitmap*,Gdk::Bitmap&,`Glib::unwrap_boxed($3)',`$3')
  223.  
  224.  
  225.  
  226. # Used by signals:
  227. _CONVERSION(`GdkDragContext*',`const Glib::RefPtr<Gdk::DragContext>&',Glib::wrap($3, true))
  228. _CONVERSION(`GdkPixbuf*',`const Glib::RefPtr<Gdk::Pixbuf>&', Glib::wrap($3, true))
  229. _CONVERSION(`GdkDragContext*',`Glib::RefPtr<Gdk::DragContext>',Glib::wrap($3, true))
  230. _CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Display>&', Glib::wrap($3, true))
  231.  
  232.